//
//  YWTempMissionManager.h
//  maintain
//
//  Created by Kyo on 16/3/4.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWSingleton.h"
#import "YWTempMission.h"

static NSString *const KRefreshPostYWTempMissionNotification = @"refreshPostYWTempMissionNotification";
static NSString *const KRefreshDeleteYWTempMissionNotification = @"KRefreshDeleteYWTempMissionNotification";
static NSString *const KRefreshModifyYWTempMissionNotification = @"KRefreshModifyYWTempMissionNotification";

@interface YWTempMissionManager : NSObject
YWSingletonH(Manager)

/**
 *  保存通知
 *
 *  @param notices 通知模型数组
 *
 *  @return 结果
 */
- (BOOL)updateTempMissionWithTempMissionArray:(NSArray*)tempMissions;

/**
 *  获取临时任务
 *
 *  @param tempMissionType 临时任务的类型（我发的还是别人发的）
 *  @param page 刷新页数
 *
 *  @return 结果
 */
- (NSArray*)tempMissionOfTypeWithMeOrOthers:(YWTempMissionType)tempMissionType page:(NSInteger)page;
/**
 *  获取临时任务
 *
 *  @param tempMissionId 临时任务id
 *
 *  @return 结果
 */
- (YWTempMission*)tempMissionWithTempMissionId:(NSInteger)tempMissionId;
/**
 *  是否存在临时任务
 *
 *  @param noticeId 公告id
 *
 *  @return 结果
 */
- (BOOL)existTempMissionWithTempMissionId:(NSInteger)tempMissionId;
/**
 *  删除临时任务
 *
 *  @param tempMissionId 临时任务id
 *
 *  @return 结果
 */
- (BOOL)deleteTempMissionWithTempMissionId:(NSInteger)tempMissionId;
/**
 *  删除临时任务的图片（修改临时任务时）
 *
 *  @param tempMissionId 临时任务id
 *
 *  @return 结果
 */
- (BOOL)deletePictureOfTempMissionWithTempMissionId:(NSInteger)tempMissionId;
/**
 *  设置临时任务的状态为已读
 *
 *  @return 结果
 */
- (BOOL)setTempMissionIsRead:(YWTempMission *)tempMission;
/**
 *  设置所有临时任务的状态为已读
 *
 *  @return 结果
 */
- (BOOL)setAllTempMissionIsRead;
/**
 *  获取临时任务的未读数
 *
 *  @return 结果
 */
- (NSInteger)tempMissionNoReadCount;

/**
 *  请求临时任务
 *
 *  @param page 分页
 *  @param pageSize 分页size
 *
 *  @return 无
 */
- (void)requestTempMissionWithPage:(NSInteger)page pageSize:(NSInteger)pageSize withComplete:(void(^)(BOOL success))complete;

/**
 *  发布临时任务
 *
 *  @param title 标题
 *  @param contnet 内容
 *  @param departments 部门
 *  @param pistures图片
 *
 *  @return 无
 */
- (void)postTempMissionWithTitle:(NSString*)title contnet:(NSString*)content completionTime:(NSString*)completionTime executors:(NSArray*)executors pistures:(NSArray*)pictures WithComplete:(void(^)(BOOL success))complete;
/**
 *  修改临时任务
 *
 *  @param id 临时任务id
 *  @param title 标题
 *  @param contnet 内容
 *  @param departments 部门
 *  @param completionTime 截止时间
 *  @param pistures图片
 *  @return 无
 */
- (void)modifyNoticeWithtempMission:(YWTempMission*)tempMission needUploadPic:(NSArray *)needUploadPic uploadedPic:(NSArray *)uploadedPic completionTime:(NSString*)completionTime WithComplete:(void(^)(BOOL success))complete;
/**
 *  请求删除临时任务
 *
 *  @param noticeId 公告id
 *
 *  @return 结果
 */
- (void)requestDeleteTempMission:(NSInteger)tempMissionId complete:(void(^)(BOOL success))complete;
@end
